package com.frxuexi.sign.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.frxuexi.lib_base.entity.VisitStatus
import com.frxuexi.sign.R

class SignStatusAdapter:BaseQuickAdapter<VisitStatus,BaseViewHolder>(R.layout.item_signstatus) {
    override fun convert(helper: BaseViewHolder, item: VisitStatus) {
        val tv = helper.getView<TextView>(R.id.sign_status)
        tv.setText(item.status)
        if(item.isCheck){
            tv.setBackgroundResource(com.frxuexi.lib_base.R.drawable.shape_solid_blue)
            tv.setTextColor(context.resources.getColor(com.frxuexi.lib_base.R.color.white))
        }else
        {
            tv.setBackgroundResource(com.frxuexi.lib_base.R.drawable.shape_solid_lightgray)
            tv.setTextColor(context.resources.getColor(com.frxuexi.lib_base.R.color.darkgray))
        }
    }
}